package pers.cz.chat.factory;

import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.util.NlsContexts;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import pers.cz.chat.ui.SettingUI;

import javax.swing.*;

/**
 * @version 1.0
 * @description: 设置页
 * @author: ChengZhi 0336
 * @create: 2025-02-19 20:22
 **/
public class SettingFactory  implements SearchableConfigurable {

	private SettingUI settingUI = new SettingUI();
	@Override
	public @NotNull @NonNls String getId() {
		return "";
	}

	@Override
	public @NlsContexts.ConfigurableName String getDisplayName() {
		return "";
	}

	@Override
	public @Nullable JComponent createComponent() {
		return null;
	}

	@Override
	public boolean isModified() {
		return false;
	}

	@Override
	public void apply() throws ConfigurationException {
		String url = settingUI.getUrlTextField().getText();
		// 设置内容
		Config.chatUi.setSourceFilePath(url);
	}
}
